package gspushmq.v1.app.subscribeapp.enumeration;

/**
 *
 * @Description 生产者者枚举
 * @Author chengsj
 * @Version 1.0
 *
 */
public enum ProducerEnum {

    GG_BACK(7701,"mis-ggmessage管理后台生成","系统提示消息"),
    GG_Live(7703,"直播后台生成","直播预约提醒消息"),
    GG_OWNSTOCK(7702,"JOB生成自选股动态","自选股动态提醒消息"),
    OHTER(7700,"其他渠道","其他消息");


    int code ;
    String name;
    String mname;

    ProducerEnum(int code, String name, String mname) {
        this.code = code;
        this.name = name;
        this.mname = mname;
    }

    public static String getMnameByCode(Integer code){
        if (code == null)
            return null;
        for (ProducerEnum en : ProducerEnum.values())
            if (en.getCode() == code)
                return en.getMname();
        return null;
    }

    public static String getNameByCode(Integer code){
        if (code == null)
            return null;
        for (ProducerEnum en : ProducerEnum.values())
            if (en.getCode() == code)
                return en.getName();
        return null;
    }
    public static boolean contain(Integer code){
        if (code == null)
            return false;
        for (ProducerEnum en : ProducerEnum.values())
            if (en.getCode() == code)
                return true;
        return false;
    }


    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public String getMname() {
        return mname;
    }

    public void setMname(String mname) {
        this.mname = mname;
    }

    public void setName(String name) {
        this.name = name;
    }
}
